package com.api.gbhg.liuwenbo.api;

import com.alibaba.fastjson.JSON;
import weaver.conn.RecordSet;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.List;

@Path("gb/IndAcc")
public class IndependentAccountingDwApi {

    /**
     * 获取所有独立核算单位id
     * @return
     */
    @POST
    @Path("/getIndAccDwId")
    @Produces(MediaType.APPLICATION_JSON)
    public String getIndAccDwId(){
        RecordSet rs = new RecordSet();
        String sql = " select xzxtdw from uf_dwsxpz where sfwdlhsdw = 1 ";
        rs.executeQuery(sql);
        List<String> list = new ArrayList<>();
        while (rs.next()){
            list.add(rs.getString("xzxtdw"));
        }
        return JSON.toJSONString(list);
    }
}
